<template>
  <div class="card" @click="$router.push('/myAddress')">
    <div class="main">
      <template  v-if="data">
        <p class="name-mobile">
          <span class="name">{{data.receiver_name}}</span>
          <span class="mobile">{{data.receiver_mobile}}</span>
          <span class="tag" v-if="data.receiver_remark && data.receiver_remark.length > 0">{{data.receiver_remark}}</span>
        </p>
        <p class="region-address"><i class="address-icon" v-if="data.region"></i>{{data.region + ' ' + data.address}}</p>
      </template>
      <template v-else>
        <p class="without-address" @click="$router.push('/myAddress')">点击添加收货地址</p>
      </template>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: null
  }
}
</script>

<style scoped lang="scss">
  @import "../../../assets/css/pub";

  .card {
    background-color: #fff;
    margin-bottom: 0;
    .main {
      padding: .25rem;
      .name-mobile {
        line-height: .75rem;
        font-size: $default_font_size;
        color: $default_title_color;
        @include textHideByLine(1);
        font-weight: bold;
        .name {
          width: 2.5rem;
        }
        .mobile {
          margin-left: .5rem;
        }
        .tag {
          margin-left: .25rem;
          padding: 0 .25rem;
          color: $default_blue_color;
          border: .0125rem solid $default_blue_color;
          font-size: $default_smallfont_size;
          font-weight: normal;
        }
      }
      .region-address {
        line-height: .75rem;
        font-size: $default_middlefont_size;
        color: $default_subtitle_color;
        @include textHideByLine(2);
        .address-icon {
          margin-right: .25rem;
          vertical-align: sub;
        }
      }

      .without-address {
        width: 100%;
        height: 1.25rem;
        background-color: #fff;
        line-height: 1.25rem;
        display: block;
        text-align: center;
      }
    }
    .main:after {
      content: '';
      display: inline-block;
      width: .3rem;
      height: .3rem;
      border-top: .0125rem solid #656565;
      border-right: .0125rem solid #656565;
      -ms-transform: rotate(45deg);
      transform: rotate(45deg);
      -webkit-transform: rotate(45deg);
      position: absolute;
      right: .375rem;
      bottom: .85rem;
    }
  }
</style>
